1. Field of the Invention
The present invention relates to a data processing apparatus for transmitting serial data to, or transmitting serial data to and receiving serial data from, an external data processing terminal.
2. Description of the Related Art
One data processing apparatus which is available at present performs data communication with external data processing terminals. According to a form of data communication, the data processing apparatus carries out both serial data transmission and serial data reception through one serial port.
However, when noise is input from an external source to the serial port, serial data transmitted from the data processing apparatus to a data processing terminal may suffer a data error. Therefore, it is necessary to confirm the abnormality of serial data that is transmitted in a serial data transmission mode.
For example, a data processing system disclosed in Japanese laid-open patent publication No. 02-274031 includes a data processing apparatus and a data processing terminal each having serial ports dedicated to data transmission and data reception, respectively. The data processing terminal returns received data to the data processing apparatus, which compares the transmitted data with the returned data to confirm the normality of the data transmission.
With the data processing apparatus which carries out both serial data transmission and serial data reception through one serial port, if the data processing terminal successively holds serial data received serially through the serial port, and returns the received data to the data processing apparatus after the serial reception is finished, then the data processing apparatus can compare the transmitted data and the returned data with each other. However, since the data processing apparatus receives, through the single serial port, the serial data by way of serial reception which has been transmitted by way of serial transmission, the data processing apparatus is unable to confirm the normality of the data transmission on a real-time basis, and has its communication rate reduced to one half.
When the data processing apparatus compares the transmitted data and the returned data from the data processing terminal with each other, even if the data processing apparatus determines that the transmitted data and the returned data do not agree with each other, it cannot confirm whether the data error has occurred during the transmission of the data to the data processing terminal or during the return of the data from the data processing terminal.
It is an object of the present invention to provide a data processing apparatus which is capable of confirming, on a real-time basis, that the serial transmission of serial data from one serial port thereof to a data processing terminal is performed normally.
According to a first aspect of the present invention, a data processing apparatus has a single serial port, a data transmitting means, an output buffer means, and a data comparing circuit, and transmits serial data to an external data processing terminal.
The data transmitting means successively generates serial data to be serially transmitted. The successively generated serial data is buffered by the output buffer means, and then serially transmitted from the serial port to the data processing terminal. When the data processing apparatus thus serially transmits serial data to the data processing terminal, the data comparing means confirms whether serial data transmitted from the data transmitting means to the output buffer means and serial data transmitted from the output buffer means to the serial port agree with each other or not. For example, if a data error occurs in serial data serially transmitted from the data processing apparatus to the data processing terminal due to noise introduced into the serial port, then the data comparing means detects that the serial data transmitted from the output buffer means to the serial port differs from the serial data transmitted from the data transmitting circuit to the output buffer circuit.
According to a second aspect of the present invention, a data processing apparatus has a single serial port, a data receiving means, a data transmitting means, an output buffer means, a buffer bypass path, a connection switching means, and a data comparing means, and performs serial communication of serial data bidirectionally with an external data processing terminal.
For performing serial reception, the connection switching means connects the buffer bypass path and the data receiving means to each other, and the data receiving means successively acquires serial data serially received through the serial port from the buffer bypass path. The data processing apparatus thus serially receives serial data from the data processing terminal. For performing serial transmission, the connection switching means connects the data transmitting means to the output buffer means, and the data transmitting means successively generates serial data to be serially transmitted. The successively generated serial data is buffered by the output buffer means, and then serially transmitted from the serial port to the data processing terminal. The data processing terminal thus serially receives serial data from the data processing apparatus.
When the data processing apparatus serially transmits serial data to the data processing terminal, the data comparing means confirms whether serial data transmitted from the data transmitting means to the output buffer means and serial data transmitted from the output buffer means to the serial port agree with each other or not. For example, if a data error occurs in serial data serially transmitted from the data processing apparatus to the data processing terminal due to a conflict between serial data transmitted between the data processing apparatus and the data processing terminal, then the data comparing means detects that the serial data transmitted from the output buffer means to the serial port differs from the serial data transmitted from the data transmitting means to the output buffer means.
The above and other objects, features, and advantages of the present invention will become apparent from the following description with reference to the accompanying drawings which illustrate examples of the present invention.